calendar object

This method will add a number of months to the month property.

bool add_months(int months)

Parameters:
months
The number of months to add.

Return value:
true on success, false on failure.

Remarks:
A negative value in the months parameter will subtract months from the current month.

There are several cases where values can change. If the date property is not valid for the new month, the date is set to the last day of the new month. If the month itself is not valid for the current year, then the year and month will be adjusted accordingly.

Example:
// Create a calendar and set it to October 7, 1767 at 09:00 and add four months.

void main()
{
calendar test;
test.set(1767, 10, 7, 9, 0, 0);
test.add_months(4);
alert("Date", "The date is "+test.weekday_name+", "+test.month_name+" "+test.day+", "+test.year+", at "+test.hour+":"+test.minute+":"+test.second);
}